<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xlmns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="author" content="lamtoan" />

	<title>ADMIN PANEL</title>
</head>
<body>	
<?php
if(isset($_REQUEST['id'])){
    include("lib_db.php");
include("function.php");
    $id=$_REQUEST['id'];
	$sql="select * from products where gid='$id'";
	$query=select_list($sql);
	$sql="select * from category_product where gid='$id'";
	$query1=select_list($sql);
	if($query || $query1){echo "<script>alert('Không thể xóa được vì có sản phẩm liên quan');window.location='group_show.php';</script>";exit();}
    $sql="delete from group_product where gid='$id'";
    $query=exec_update($sql);
    
    header("location:group_show.php");exit();
}

?>
</body>
</html>